package com.ruoyi.activiti.controller;

import com.ruoyi.activiti.utils.ActivitiUtils;
import com.ruoyi.common.core.domain.AjaxResult;
import org.activiti.engine.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/engine")
public class EngineController {


    @Autowired
    private TaskService taskService;

    /**
     *
     *  完成审批 根据任务ID
     *
     */
    public AjaxResult completeTask(String taskId) {

        taskService.complete(taskId);

        return AjaxResult.success();
    }

    /**
     *
     *  根据用户ID查询当前用户下的任务
     *
     */
    public AjaxResult getTaskByUserId() {

        return AjaxResult.success();
    }

    /**
     *
     *  根据用户ID查询当前用户的历史流程记录
     *
     */
    public AjaxResult getHistoryTaskByUserId() {

        return AjaxResult.success();
    }

    /**
     *
     *  创建任务流程
     *
     */
    public AjaxResult createTask() {

        return AjaxResult.success();
    }

    /**
     *
     *  查询所有流程实例
     *
     */
    public AjaxResult getTaskList() {

        return AjaxResult.success();
    }
}
